package org.i0o.appliancemanager.model;


/**
 * @author <a href="mailto:781131@gmail.com">HTF</a>
 * @version 2010-5-14
 */
public abstract class SearchVo
	implements IViewObject {

	private static final long serialVersionUID = 610800435443955457L;

	// 起始索引
	private int start;

	// 页大小
	private int limit;

	private String sort;

	private String dir;

	private String callback;

	/**
	 * 获取页大小
	 * 
	 * @return
	 */
	public int getPageSize() {
		return limit == 0 ? 20 : limit;
	}

	/**
	 * 获取页数
	 * 
	 * @return
	 */
	public int getPageNo() {
		return start / this.getLimit() + 1;
	}

	/**
	 * 获取起始索引
	 * 
	 * @return
	 */
	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getLimit() {
		return limit == 0 ? 20 : limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getDir() {
		return dir;
	}

	public void setDir(String dir) {
		this.dir = dir;
	}

	public String getCallback() {
		return callback;
	}

	public void setCallback(String callback) {
		this.callback = callback;
	}

}
